#include "wifi.h"
char wifi_data[15];
void wifi_transmit(uint16_t fuyang)
{
	printf("AT+MQTTPUB=0,\"/k0o2vTxYhy2/devicename/user/SHUJU\",\"{\\\"DATA\\\":%d}\",1,0\r\n",fuyang);
	HAL_Delay(500);
}
void wifi_init(void)
{
	printf("AT+RST\r\n");
	HAL_Delay(1000);
	printf("AT+CWMODE=1\r\n");
	HAL_Delay(1000);
	printf("AT+CWJAP=\"espwifi\",\"12345678\"\r\n");
	HAL_Delay(3000);
	printf("AT+MQTTUSERCFG=0,1,\"NULL\",\"devicename&k0o2vTxYhy2\",\"b94b2d84e72f2a63380b98b1583c0c6326a1413d42162420fa6294883be8a88a\",0,0,\"\"\r\n");
	HAL_Delay(1000);
	printf("AT+MQTTCLIENTID=0,\"k0o2vTxYhy2.devicename|securemode=2\\,signmethod=hmacsha256\\,timestamp=1716532457745|\"\r\n");
	HAL_Delay(1000);
	printf("AT+MQTTCONN=0,\"iot-06z00j2prt9lr1n.mqtt.iothub.aliyuncs.com\",1883,1\r\n");
	HAL_Delay(1000);
	printf("AT+MQTTSUB=0,\"/k0o2vTxYhy2/devicename/user/KONGZHI\",1,\r\n");
	HAL_Delay(1000);
//	HAL_UART_Receive_IT(&huart3,(uint8_t*)wifi_data,15);
}
	
